import { Component, OnInit, ContentChild, TemplateRef, AfterContentInit } from '@angular/core';
import { NzModalRef } from 'ng-zorro-antd';

@Component({
  selector: 'bz-modal-title',
  template: ''
})
export class ModalTitleComponent implements OnInit, AfterContentInit {

  @ContentChild(TemplateRef, { static: true }) templateRef: TemplateRef<any>;

  constructor(
    private nzModalRef: NzModalRef
  ) { }

  ngOnInit() {

  }

  ngAfterContentInit(): void {
    this.nzModalRef.getInstance().nzTitle = this.templateRef;
  }

}
